#ifndef   H_A2PACK
#define   H_A2PACK

#define A2P_OK        0  /* error codes        */
#define A2P_INVDICT (-1)
#define A2P_INVMODE (-2)
#define A2P_INVDATA (-3)
#define A2P_ABORT   (-4)
#define A2P_NOTSET  (-5)
#define A2P_NOMEM   (-6)

#define A2P_INIPACK   1 /* modes for a2SetPack */
#define A2P_RESPACK   2 /* combined by OR (|)  */
#define A2P_INIUNPK   4
#define A2P_RESUNPK   8
#define A2P_BIN  (0*256)
#define A2P_ASC  (1*256)

#ifdef __cplusplus      /* functions           */
 extern "C" {
#endif

int far pascal a2pkSET (
   int mode,
   void far * (far *mem_alloc)(unsigned int sz),
   void       (far *mem_free )(void far *block)
);

int far pascal a2pkPACK (
  int (far pascal *rd)(char far *buff, unsigned int sz),
  int (far pascal *wr)(char far *buff, unsigned int sz)
);

int far pascal a2pkUNPK (
  int (far pascal *rd)(char far *buff, unsigned int sz),
  int (far pascal *wr)(char far *buff, unsigned int sz)
);

unsigned long far pascal a2pkCRC (
   void far *pBuf, unsigned int bLen, unsigned long curCRC
);

#ifdef __cplusplus
 }
#endif

#endif /* H_A2PACK */
